import axios from "axios"
import { Turnout } from "../models"
import { ElNotification } from "element-plus"

export const saveTurnouts = async (turnouts: Turnout[]) => {
    await axios.post('/api/turnouts/save', turnouts)
    ElNotification.success({
        title: "Success",
        message: "道岔配置保存成功"
    })
}

export const loadTurnouts = async (): Promise<Turnout[]> => {
    const res = await axios.get('/api/turnouts/load')
    return res.data
}